NCREE MATS changes	BKT 05-Nov-10

General:

Since this machine was envisioned only as a bearing tester,
the static actuator currently is an entity separate from the the
DOF actuators.  However, the customer now wants to run structural tests,
and in order to accomodate this kind of testing, the static actuator
must be brought into the DOF control system.  The customer still wants
to do bearing tests, so any modifications made to accomodate structural
testing must not rule out bearing testing.

vm.c:

The realtime COOPS objects associated with the static actuator are:

	condFFbkSA, condFFbkSB	(force fbk conditioners)
	adcFFbkSA, adcFFbkSB,	(force fbk a/d scalers)
	obsFFbkS		(force fbk observer )
				(does adcFFbkSA - adcFFbkSB)
	setptS			(setpoint)
	srvS			(servocontroller)
	limFFbkS		(force fbk limit detector)
	condSvA, condSvB	(servovalve conditioners)

Corresponding realtime COOPS objects associated with DOF control that
reside in actuator space (DOF space objects are not of concern here)
are:

	condFFbk		(force fbk conditioner array)
	adcFFbk			(delta-p force fbk a/d scaler array)
	adcFFbkL		(loadcell force fbk a/d scaler array)
	srvBal			(force balance servocontroller array)
	condSv			(servovalve conditioner array)

Currently there are NACT each of these objects, where NACT is 14.

It would be nice just to redefine NACT as 15, with the static actuator
as the 15th actuator.  It's not that simple, because because the static
actuator has two force fbk conditioners instead of one, and two servovalve
conditioners instead of one.  The actuator force feedback comes from
the observer obsFFbkS instead of a/d scaler adcFFbk.  There is no loadcell
force sensor for the static actuator.

So what will be necessary is to look at every "for" loop that loops up
to NACT, and selectively account for these differences.  This can be done
by changing these loops to NACT-1, and then adding code for NACT-th
actuator, the static actuator.

Coordinate transforms:  The version used in MATS is old and does not
accomodate actuators of different force capability.  It is crucial in this
application that the force balance solution be weighted according to
actuator force capacity.  Also, because the static actuator has much
lower velocity capacity than the surrounding dynamic actuators, it is
imperative that the jacobian output be scaled according to max velocity.
The latest Table.alt does this; the old Table.alt does not.
So use the latest version of the following files:
	xfmlim.c/.h
	Act2Tbl.c
	Table.alt
The latest versions of these files have differences in calling protocol
from the old versions--- be careful when updating.

constants.alt:
1) Define nAct as 15.
2) Define new actuator id "s1" as 15.

VirtualMachine.alt:
1) After instantiating StaticActuator, place this into the 15th
   location of array "achan".
2) Add a method that gets called when Table.dat is called in, which places
   the controller either in bearing test mode or structural test mode.
   This method must rewire the input to the static actuator servovalve
   conditioners:
   a) if bearing test mode, connect srvS.out to condSvSA/SB.inp
   b) if structural test mode, connect sumBal.out[nAct] to condSvSA/SB.inp

StaticActuator.alt:  Make this class look like DynamicActuator.
1) Add force balance servo and associated testpoints.
2) Stub out testpoints that don't exist (tpDFbk, etc.) by defining methods
   of these names but return NIL.  VirtualMachine method addTp calls these
   methods when adding testpoints to the testpoint list.

TableBTS.alt:
1) Method updateUnits should copy static units saunitsF into
   aunitsF[FORCEDIM, i], which is now dimension 15 instead of 14.
2) Add method "testMode" which returns 1 for "bearing test mode" and
   2 for "structural test mode".  The decision is based on the force sensor
   activation array for the static actuator:  if 0, then static actuator is
   not in the DOF system so it's a bearing tester; if 1, then it is in the
   DOF system so it's a structural test system.

Table.dat files:
1) Increase array sizes from 14 to 15.
2) Fill in the max displ, veloc, accel, and force for the 15th actuator.
3) Fill in the geometric info for the 15th actuator (rh, rb, and rl).
4) Fill in the activation info for the 15th actuator:
	displ activation will always be 0 (sensor doesn't exist)
	veloc & accel activation will always be 0 (sensors don't exist)
	force activation will be 0 or 1:  Make two Table.dat files, one
	with 0 and one with 1.

MainPanel.alt:
1) Enable/disable force setpoint based on what is returned from
   vm.table.testMode, a method added to TableBTS.alt.
2) There are probably many other things to do to the main panel GUI.
   See Rod or have him make the necessary changes.

Addition:  Add a limit detector to the difference between the sum of the
vertical dynamic actuators and the static actuator dFz:
	dFz = (Fz1+Fz2+Fz3+Fz4+Fz5+Fz6) - Fstatic
This is useful in bearing test mode because bad stuff happens if the static
actuator gets out of sync with the vertical dynamic actuators. Use an observer
(instance of CCMatrix in vm.c) to compute dFz, connected to an instance of
LimitDet.  In the GUI, have a testpoint for dFz so it can be seen in the
meters and oscilloscope.

Check:  Check methods abort and pause in MainPanel and VirtualMachine to see
if what they do still makes sense in structural test mode.
	
Caution: Find every reference to "achan", and see if what is being done with
it makes sense given that not all elements of this array are instances of
DynamicActuator.  Especially if a "forAll" is being done to it or a WHILE
loop.

During operation:  Customer has to select the correct Table.dat file
depending on whether he is doing bearing testing (force activation = 0)
or structural testing (force activation = 1).  Currently he has to do this
for different numbers of actuators and geometries.  It would be nicer for
him to be able to call in different Table.dat files of unique names, but
this feature is not currently in the s/w.  To see how to do this, look at
project "reno469D6".

Caveat:  This document probably hasn't caught all the things that must be
done to turn the MATS into a structural test machine, but it's a good first
step.
